//Copyright 2011 New York City 3D Community

//This file is part of New York City 3D.

//New York City 3D is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.

//New York City 3D is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with New York City 3D.  If not, see <http://www.gnu.org/licenses/>.

package nyc3d.gui;

import nyc3d.NYC3D;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.controls.button.builder.CreateButtonControl;
import de.lessvoid.nifty.elements.render.TextRenderer;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;
import nyc3d.updates.UpdateManager;

/**
 *
 * @author Joseph
 */
public class GameSystemInfoScreen implements ScreenController{
    /**
   * the nifty instance.
   */
  private Nifty nifty;

  /**
   * the screen this menu belongs to.
   */
  private Screen screen;

  /**
   * bind.
   * @param niftyParam niftyParam
   * @param screenParam screenParam
   */
  public void bind(final Nifty niftyParam, final Screen screenParam) {
    this.nifty = niftyParam;
    this.screen = screenParam;

    screen.findElementByName("currentVersion").getRenderer(TextRenderer.class).setText(UpdateManager.gameVersion + " " + UpdateManager.modifier);

    CreateButtonControl createBackButtonSave = new CreateButtonControl("backButton");
    createBackButtonSave.set("label", "Return");
    createBackButtonSave.setAlign("right");
    createBackButtonSave.setInteractOnClick("returnToAboutMenu()");
    createBackButtonSave.create(nifty, screen, screen.findElementByName("buttonPanel"));
  }

  /**
   * just goto the next screen.
   */
  public final void onStartScreen() {
  }

  public final void onEndScreen() {
  }

  public void returnToAboutMenu(){
      nifty.fromXml("about.xml", "about");
  }


}